<template>
  <div class="group">
    <SonDemo1>
      <div>
        <p>我是默认插槽</p>
      </div>
    </SonDemo1>
  </div>
  <div class="group">
    <SonDemo2>
      <template #header="messages">
        <p>我是具名组件header</p>
        <p>{{ messages.message.id }}---{{ messages.message.name }}</p>
      </template>
      <!-- <template v-slot:footer>
        <p>我是具名组件footer</p>
      </template> -->
      <template #footer="{ id, name }">
        <p>我是具名组件footer</p>
        <p>我是接收传的值并解构得来的--{{ id }}----{{ name }}</p>
      </template>
    </SonDemo2>
  </div>
  <div class="group">
    <SonDemo3 :dataarr="dataarr">
      <template #cell="{ row }">
        <strong>{{ row.name }}</strong>
      </template>
      <template #ema="{ row }">
        <strong>{{ row.email }}</strong>
      </template>
    </SonDemo3>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import SonDemo1 from './Anli3/StuDemo1.vue'
import SonDemo2 from './Anli3/StuDemo2.vue'
import SonDemo3 from './Anli3/StuDemo3.vue'

const dataarr = ref([
  {
    id: 1,
    name: '张三',
    email: '203425028@qq.com'
  },
  {
    id: 2,
    name: 'Jane Doe',
    email: 'jane@example.com'
  }
])
</script>

<style lang="scss" scoped>
.group {
  border: 1px solid rgb(60, 130, 200);
  padding: 10px;
  margin: 10px;
  box-sizing: border-box;
}
</style>
